<?php
/**
 * SpecialTemplateForm is the data structure for keeping special template data.
 * 
 * Yawii 版权所有 @ 2012
 */
class SpecialTemplateForm extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return ShopProfile the static model class
	 */
	public static function model($className = __CLASS__) {
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName() {
		return 'tbl_merchant_special_template';
	}

	/**
	 * Declares the validation rules.
	 */
	public function rules() {
		return array(
			// fields are required
			array('value, content', 'required'),
			array('url_picture, type, max_number', 'safe'),
			array('price, value, discount, content', 'unsafe'),
		);
	}

	/**
	 * Declares attribute labels.
	 */
	public function attributeLabels() {
		return array(
			'content' => BUtils::T('special_content_lbl'),
			'price' => BUtils::T('special_price_lbl'),
			'value' => BUtils::T('special_value_lbl'),
			'discount' => BUtils::T('discount_lbl'),
			'url_picture' => BUtils::T('special_offer_picture_lbl'),
		);
	}
}
